<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.xhd.vo.Fruits"%>
<%@page import="java.util.List"%>
<%@page import="com.xhd.Dao.SalerDaoImpl"%>
<%@page import="com.xhd.Dao.SalerDao"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
	<title>小虎队水果店-商品详情页</title>
	<link rel="stylesheet" href="./css/main.css">
	<link rel="stylesheet" href="./css/reset.css">
	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
</head>
<body>

<% 
	SalerDao sd = new SalerDaoImpl();
	List<Fruits> fruitlist=sd.haveFruitOrNot("待售");
	Iterator<Fruits> fIter=fruitlist.iterator();
	if (!fIter.hasNext()){
	%>	
	抱歉，商品已售罄！<br>
	<a href="HomePage.jsp">点击此处</a>返回主界面
	<%	
	}
	else {
		Fruits fruit=null;
		while(fIter.hasNext()){
			fruit=fIter.next();
	%>
	<!-- 头部信息 -->
	<div class="header_con">
		<div class="header">
			<div class="welcome">欢迎来到小虎队水果店!</div>
			
		</div>
	</div>
	<div class="search_bar clearfix">
		<a href="#" class="logo fl"><img src="./images/logo.png"></a>
	</div>

	<div class="center_con clearfix">
		<div class="main_menu fl"><img src=<%=fruit.getFruit_picture() %>></div>
		<div class="goods_detail_list fr">
			<h3><%=fruit.getFruit_name() %></h3>
			<p><%=fruit.getFruit_describe() %></p>
			<div class="prize_bar">
				<div class="show_prize fl">￥<em><%=fruit.getFruit_price() %></em></div>
				<div class="show_unit fl">单位：500g</div>
			</div>
			<div class="goods_num clearfix">
				<div class="num_name fl">数量：1</div>
				<div class="num_add fl">
					<input type="text" class="num_show fl" value="1">
					<a href="javascript:;" class="add fr">+</a>
					<a href="javascript:;" class="minus fr">-</a>
				</div>
			</div>
			<div class="total">总价：<em><%=fruit.getFruit_price() %></em></div>
			<div class="operate_btn">
				<a href="Buy.jsp?order_fruit=apple" class="buy_btn">立即购买</a>
			</div>
		</div>
	</div>
	<%	
		}
	}
	%>
</body>
</html>
